<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:p="http://primefaces.prime.com.tr/ui">


	<ui:composition template="/templates/staff/content.xhtml">
		<ui:define name="pageTitle">HomePage</ui:define>
		<ui:define name="body">
			<div class="container_24">
				<div class="wrapper">
					<ui:include src="/templates/staff/sidebar_for_staff.xhtml"></ui:include>
					<div class="grid_17">
						<div class="inside">
						<h:form id="common-form">
						
							<article> <header>
							<h2>Admin Home Page</h2></header>
							</article>
							<article>
							<h3>Property Statistics Information </h3>
							<table width="100%" cellspacing="5" cellpadding="5" border="0">
								<tbody>
									<tr>
										<td width="160px" style="padding-right:5px;">Overview Report Quick Menu: </td>
										<td>
											
											<h:selectOneMenu style="margin-bottom:20px;" value="#{mStat.statType}" id="stat_select_type" styleClass="stat_type_class">
												<f:selectItem itemValue="tv" itemLabel="Total Views Property" />
												<f:selectItem itemValue="tp" itemLabel="Total Properties" />
											</h:selectOneMenu>
											
										</td>
									</tr>
								</tbody>
							</table>	
							
							<h:panelGroup id="statViewPanel">
								<center>
									<p:columnChart rendered="#{mStat.statType == 'tv'}" value="#{mStat.eachPropertyTypeView}" var="propertyview" xfield="#{propertyview.propertyType}">  
										    <p:chartSeries label="Views" value="#{propertyview.totalView}" />  
									</p:columnChart> 
									<p:columnChart rendered="#{mStat.statType == 'tp'}" value="#{mStat.totalProperty}" var="propertytt" xfield="#{propertytt.propertyType}">  
										    <p:chartSeries label="Properties" value="#{propertytt.totalProp}" />  
									</p:columnChart>  
								</center>
							</h:panelGroup>
							</article>
							<a4j:jsFunction name="changeStat" id="change_stat_ajax" render="statViewPanel">
									<a4j:param name="stat_type" assignTo="#{mStat.statType}" />
							</a4j:jsFunction>
							<article>
								<h3>Site Statistics Summary</h3>
								<table class="stat_details_table" border="1">
									<thead>
									<tr>
										<th colspan="6">Site Statistics</th>
									</tr>
									</thead>
									<tbody>
										<tr>
											<td class="item_header" width="50%">Total Users: </td>
											<td class="item_content">#{mStat.totalUsers}</td>
										
										</tr>
										<tr>
											<td class="item_header" width="50%">Total Properties: </td>
											<td class="item_content">#{mStat.totalProps}</td>
										
										</tr>
										<tr>
											<td class="item_header" width="50%">Total Views: </td>
											<td class="item_content">#{mStat.totalviews}</td>
										
										</tr>
										<tr>
											<td class="item_header" width="50%">Total Staffs: </td>
											<td class="item_content">#{mStat.totalStaff}</td>
										</tr>
									</tbody>
								</table>
							
							</article>
						</h:form>
						</div>
					</div>
				</div>
			</div>
			<input type="hidden" name="identifier" value="Home" />
		</ui:define>
	</ui:composition>
	

</html>